import 'package:fish_redux/fish_redux.dart';
import 'package:www.znpigai.teacher/pay_list_page/state.dart';

enum PayListAction {
  onLoad,
  loaded,
  loading,
  listResult,
  onReload,
  onPay,
  purchase,
  button,
}

class PayListActionCreator {
  static Action onLoad() {
    return Action(PayListAction.onLoad);
  }

  static Action loading() {
    return Action(PayListAction.loading);
  }

  static Action loaded() {
    return Action(PayListAction.loaded);
  }

  static Action listResult(List items, var pageTotal, var pageIndex) {
    return Action(PayListAction.listResult, payload: {
      'items': items,
      "pageTotal": pageTotal,
      "pageIndex": pageIndex
    });
  }

  static Action onReload(callback) {
    return Action(PayListAction.onReload, payload: callback);
  }

  static Action onPay(String value) {
    return Action(PayListAction.onPay, payload: value);
  }

  static Action purchase(PayListState paramState) {
    return Action(PayListAction.purchase, payload: paramState);
  }

  static Action button(String text) {
    return Action(PayListAction.button, payload: text);
  }
}
